/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.clinicplus.entity;

import br.com.foxline.clinicplus.enums.CivilStatus;
import br.com.foxline.clinicplus.enums.Gender;
import br.com.foxline.clinicplus.util.Caracter;
import br.com.foxline.clinicplus.validator.CPF;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author roniere
 */
@Entity
public class Customer implements Serializable{

    @Id
    @SequenceGenerator(sequenceName = "seq_customer", name = "seq_customer", allocationSize = 1)
    @GeneratedValue(generator = "seq_customer", strategy = GenerationType.SEQUENCE)
    private Long id;
    private String name;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateBirth;
    private String email;
    @Enumerated(EnumType.STRING)
    private Gender gender;
    @ManyToOne
    private Annex annex;
    
    private String phone;
    private String cellular;
    
    @CPF
    private String cpf;
    private String rg;
    private String filiationMother;
    private String occupationMother;
    private String filiationFather;
    private String occupationFather;
    private String responsible;
    private String nacionality;
    @Enumerated(EnumType.STRING)
    private CivilStatus civilStatus;
    private String occupation;
    @OneToOne(cascade= CascadeType.ALL)
    private Address address;
    @ManyToOne
    private Operator operator;
    private String cardNumber;
    private String validateCard;
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date createAt;
    @ManyToOne
    private SystemUser systemUser;
    
    
    //@Version
    private int version;
    
    private boolean ativo;


    public Customer() {
    }

    
    public boolean isAtivo() {
        return ativo;
    }

    public void setAtivo(boolean ativo) {
        this.ativo = ativo;
    }
    
    

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }
    

    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    public String getCellular() {
        return cellular;
    }

    public void setCellular(String cellular) {
        this.cellular = cellular;
    }

    public CivilStatus getCivilStatus() {
        return civilStatus;
    }

    public void setCivilStatus(CivilStatus civilStatus) {
        this.civilStatus = civilStatus;
    }

    public String getCpf() {
        return cpf;
    }

    public void setCpf(String cpf) {
        this.cpf = Caracter.removecaracter(cpf);
    }

    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public Date getDateBirth() {
        return dateBirth;
    }

    public void setDateBirth(Date dateBirth) {
        this.dateBirth = dateBirth;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getFiliationFather() {
        return filiationFather;
    }

    public void setFiliationFather(String filiationFather) {
        this.filiationFather = filiationFather;
    }

    public String getFiliationMother() {
        return filiationMother;
    }

    public void setFiliationMother(String filiationMother) {
        this.filiationMother = filiationMother;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

   

    public String getNacionality() {
        return nacionality;
    }

    public void setNacionality(String nacionality) {
        this.nacionality = nacionality;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = Caracter.removeCaracterSpecials(name);
    }

    

    public String getOccupation() {
        return occupation;
    }

    public void setOccupation(String occupation) {
        this.occupation = occupation;
    }

    public String getOccupationFather() {
        return occupationFather;
    }

    public void setOccupationFather(String occupationFather) {
        this.occupationFather = occupationFather;
    }

    public String getOccupationMother() {
        return occupationMother;
    }

    public void setOccupationMother(String occupationMother) {
        this.occupationMother = occupationMother;
    }

    public Operator getOperator() {
        return operator;
    }

    public void setOperator(Operator operator) {
        this.operator = operator;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getResponsible() {
        return responsible;
    }

    public void setResponsible(String responsible) {
        this.responsible = responsible;
    }

    public String getRg() {
        return rg;
    }

    public void setRg(String rg) {
        this.rg = rg;
    }

    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }

    public String getValidateCard() {
        return validateCard;
    }

    public void setValidateCard(String validateCard) {
        this.validateCard = validateCard;
    }

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }

    public Annex getAnnex() {
        return annex;
    }

    public void setAnnex(Annex annex) {
        this.annex = annex;
    }

    @Override
    public String toString() {
        return "Customer{" + "id=" + id + ", name=" + name + ", dateBirth=" + dateBirth + ", email=" + email + ", gender=" + gender + ", annex=" + annex + ", phone=" + phone + ", cellular=" + cellular + ", cpf=" + cpf + ", rg=" + rg + ", filiationMother=" + filiationMother + ", occupationMother=" + occupationMother + ", filiationFather=" + filiationFather + ", occupationFather=" + occupationFather + ", responsible=" + responsible + ", nacionality=" + nacionality + ", civilStatus=" + civilStatus + ", occupation=" + occupation + ", address=" + address + ", operator=" + operator + ", cardNumber=" + cardNumber + ", validateCard=" + validateCard + ", createAt=" + createAt + ", systemUser=" + systemUser + ", version=" + version + '}';
    }

    
}
